const express = require('express');

const router = express.Router();

router.get('/check', (req, res, next) => {
  const { text } = req.query;
  if (text === '123456') {
    res.send({ text: 'you are nice' });
    return;
  }
  res.send({ text: 'you are a pig' });
});

/* GET home page. */
router.get('/', (req, res, next) => {
  const meta = { a: 1 };
  res.render('index', { meta });
});

module.exports = router;
